
package com.eyedog.uilibrary.base;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.eyedog.uilibrary.R;

public class BaseDialog extends Dialog {

    protected TextView mTitle, mContent, mCancel, mConfirm;

    public BaseDialog(@NonNull Context context) {
        this(context, R.style.CustomDialog);
    }

    public BaseDialog(@NonNull Context context, int theme) {
        super(context, theme);
    }

    protected BaseDialog(@NonNull Context context, boolean cancelable,
            @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_base);
        mTitle = (TextView) findViewById(R.id.tv_dialog_title);
        mContent = (TextView) findViewById(R.id.tv_dialog_content);
        mCancel = (TextView) findViewById(R.id.tv_dialog_cancel);
        mConfirm = (TextView) findViewById(R.id.tv_dialog_confirm);

        mCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });
    }
}
